Content starts here Running the Mediator API Sample Projects
This page last changed on Jun 23, 2008.

edocs Home > BEA AquaLogic Data Services Platform 3.0/3.2 Documentation > ALDSP 3.2 New Features Documentation

How To Run the Mediator API Sample Projects

This topic describes how to run the Mediator API sample projects.

Topic Map


Advanced API Samples - Mediator, Web Services, and DSP Controls

Running the Standalone Samples Using the Custom Run Configuration

You can run the following standalone Mediator API sample projects using a custom configuration:

  1. Launch Workspace Studio.
  2. Verify that the server is started and the RetailDataspace sample project is deployed.
    If an unexpected problem is flagged in the Project Explorer, try the Clean project option
    Project > Clean
  3. Make sure the Console window is open:
    Window > Show View > Other > Console
  4. Right-click on DSPClientSamplesStatic1 and choose Run As > Run.
  5. Expand Java Application and select the Static run configuration.
  6. Click Run.

You can run the DSPClientSamplesDynamic1 sample using the steps shown above.

Selecting the Run Configuration

The sample project includes an optional parameter enabling you to choose the following client types:

  • Use java or do not set the parameter to have the sample project use the Mediator API.
  • Use webservice to have the sample project use the Web Service Mediator API.

The parameter can be specified in the Arguments tab as a program argument such as:

webservice
Specifying an Argument

The results appear in the Console Window.

Console After Running Static Mediator Sample with webservice Parameter

Running the Sample Controls Using "Run on Server"

You can run the Mediator API sample controls using the "Run on Server" option.

If you see "Missing Struts Module Configuration" when trying to run the Mediator API sample controls, it is likely because you need to install WebLogic Workshop 10.2 (in addition to what comes with the ALDSP installer).

You can download WebLogic Workshop 10.2 at http://commerce.bea.com/showproduct.jsp?family=WLW&major=10.2&minor=0

To run the sample projects:

  1. Launch Workspace Studio.
  2. Verify that the server is started and the RetailDataspace sample project is deployed.
  3. Right-click the dataspace project and choose Run As > Run on Server.
Selecting the Server

Select the server and click Next.

Adding the Project

Add the required project, and click Finish. You can specify an optional parameter to use the Mediator API or Web Services Mediator API.

Using the Advanced APISample Projects with ALDSP 3.0

The samples are tested with ALDSP 3.2 and 3.01.

If you are using ALDSP 3.0, you need to call the getContextClassLoader() method before accessing the DataAccessService. Specifically, when using the Java or DSP Control Mediator API, call the following method before accessing the DataAccessService:

com.bea.dsp.das.HelperContextCache.setClassLoader("RetailDataspace", Thread.currentThread.getContextClassLoader();

Similarly, when using the Web Services Mediator API, call the following method before accessing the DataAccessService:

com.bea.dsp.das.HelperContextCache.setClassLoader(
   "http://localhost:7001/RetailDataspace/RetailApplication/CustomerManagement/ProfileService.ws?WSDL",
   Thread.currentThread.getContextClassLoader());

Related Topics

How Tos
Reference
Document generated by Confluence on Jul 03, 2008 12:11